package com.button.springboothdfsclient.controller;

import com.button.springboothdfsclient.service.HdfsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @Description
 * @Author Administrator
 * @Date 2023/2/2 11:59
 **/
@RestController
@Slf4j
public class HdfsController {

    @Autowired
    private HdfsService hdfsService;

    @GetMapping("upload")
    public void upload() throws IOException {
        hdfsService.upload2Hdfs();
    }

    @GetMapping("download")
    public void download() throws IOException {
        hdfsService.downloadFromHdfs();
    }
}
